let aa=document.querySelector(".aa");
let bb=document.querySelector(".bb");
let cc=document.querySelector(".cc");
let token=localStorage.getItem("token");
console.log(token)
let smallApi="http://15637237221.wicp.vip/yh/HomePage/comprehensiveClass.do";
//综合
axios.post(smallApi,{
	"token":"token", 
	"pageNum":1,
	"pageSize":10
})
.then(res=>{
	console.log(res.data.info);
	// classId: "1"
	// classImgUrl: "http://15637237221.wicp.vip/show/test.jpg"
	// classInfo: "小班1描述"
	// className: "小班1"
	// classNumber: 20
	// classTime: "15:32:39"
	// createTime: "2019-10-04T07:32:36.000+0000"
	// createUserId: "1"
	// creator: {userId: "1", id: "1", username: "一", password: "123456", phone: "12123456787", …}
	// teacher: {userId: "1", id: "1", username: "一", password: "123456", phone: "12123456787", …}
	// teacherUserId: "1"
	let html=res.data.info.map(v=>`
	<div class="main2">
		<a href="">
			<img src="${v.classImgUrl}">
		</a>
		<div class="m-bottom">
			<div class="m1">
				<h3>${v.className}</h3>
				<span>${v.classInfo}</span>
			</div>
			<div class="mm">
				<span>导师:${v.teacher.username}</span>
				<span class="s">${v.classNumber}人已购</span>
			</div>
		</div>
	</div>
	`).join("");
	// console.log(html)
	aa.innerHTML=html;
})


//热门
let smallApi2="http://15637237221.wicp.vip/yh/HomePage/hottestClass.do"
axios.post(smallApi2,{
	"token":"token", 
	"pageNum":1,
	"pageSize":10
})
.then(res=>{
	console.log(res.data.info);
	let html=res.data.info.map(v=>`
	<div class="main2">
		<a href="">
			<img src="${v.classImgUrl}">
		</a>
		<div class="m-bottom">
			<div class="m1">
				<h3>${v.className}</h3>
				<span>${v.classInfo}</span>
			</div>
			<div class="mm">
				<span>导师:${v.teacher.username}</span>
				<span class="s">${v.classNumber}人已购</span>
			</div>
		</div>
	</div>
	`).join("");
	// console.log(html)
	bb.innerHTML=html;
})

//新增/HomePage/latestClass.do
let smallApi3="http://15637237221.wicp.vip/yh/HomePage/latestClass.do";
axios.post(smallApi3,{
	"token":"token", 
	"pageNum":1,
	"pageSize":10
})
.then(res=>{
	console.log(res.data.info);
	let html=res.data.info.map(v=>`
	
	<div class="main2">
		<a href="">
			<img src="${v.classImgUrl}">
		</a>
		<div class="m-bottom">
			<div class="m1">
				<h3>${v.className}</h3>
				<span>${v.classInfo}</span>
			</div>
			<div class="mm">
				<span>导师:${v.teacher.username}</span>
				<span class="s">${v.classNumber}人已购</span>
			</div>
		</div>
	</div>
	`).join("");
	// console.log(html)
	cc.innerHTML=html;
})
